home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-22 | 66.8 KB | 2,302 lines |
- diff -u -r --new-file last-version/docs/BROWSING.txt samba-1.9.15p3/docs/BROWSING.txt
- --- last-version/docs/BROWSING.txt Tue Nov 21 12:46:25 1995
- +++ samba-1.9.15p3/docs/BROWSING.txt Wed Nov 22 22:07:16 1995
- @@ -87,11 +87,41 @@
- elections to just about anyone else.
-
- If you want Samba to win elections then just set the "os level" global
- -option in smb.conf to a higher number. It defaults to 0. Using 3 would
- -make it win all elections over every other system (except other samba
- -systems!)
- +option in smb.conf to a higher number. It defaults to 0. Using 33
- +would make it win all elections over every other system (except other
- +samba systems!)
-
- -A "os level" of 2 would make it beat WfWg and Win95, but not NTAS.
- +A "os level" of 2 would make it beat WfWg and Win95, but not NTAS. A
- +NTAS domain controller uses level 32.
- +
- +The maximum os level is 255
- +
- +MAKING SAMBA THE DOMAIN MASTER
- +==============================
- +
- +The domain master is responsible for collating the browse lists of
- +multiple subnets so that browsing can occur between subnets. You can
- +make samba act as the domain master by setting "domain master = yes"
- +in smb.conf. By default it will not be a domain master.
- +
- +When samba is the domain master and the master browser it will listen
- +for master announcements from other subnets and then contact them to
- +synchronise browse lists.
- +
- +If you want samba to be the domain master then I suggest you also set
- +the "os level" high enough to make sure it wins elections.
- +
- +NOTIFYING THE DOMAIN CONTROLLER
- +===============================
- +
- +If you have a domain controller for the domain which Samba is a part
- +of then you should add the line "domain controller = address" to
- +smb.conf. "address" can either be a name available via DNS or a IP
- +address or a broadcast address. If it is a broadcast address then
- +Samba will look for a domain controller on that network.
- +
- +When Samba is the master browser it will regularly contact the domain
- +controller to synchronise browse lists.
-
-
- NOTE ABOUT BROADCAST ADDRESSES
- diff -u -r --new-file last-version/docs/smb.conf.5 samba-1.9.15p3/docs/smb.conf.5
- --- last-version/docs/smb.conf.5 Tue Nov 14 22:47:42 1995
- +++ samba-1.9.15p3/docs/smb.conf.5 Wed Nov 22 10:30:40 1995
- @@ -435,6 +435,8 @@
-
- allow hosts
-
- +alternate permissions
- +
- available
-
- browseable
- @@ -557,6 +559,8 @@
-
- valid users
-
- +volume
- +
- wide links
-
- writable
- @@ -649,6 +653,26 @@
-
- .B Example:
- allow hosts = 150.203.5. myhost.mynet.edu.au
- +
- +.SS alternate permissions (S)
- +
- +This option affects the way the "read only" DOS attribute is produced
- +for unix files. If this is false then the read only bit is set for
- +files on writeable shares which the user cannot write to.
- +
- +If this is true then it is set for files whos user write bit is not set.
- +
- +The latter behaviour of useful for when users copy files from each
- +others directories, and use a file manager that preserves
- +permissions. Without this option they may get annoyed as all copied
- +files will have the "read only" bit set.
- +
- +.B Default:
- + alternate permissions = no
- +
- +.B Example:
- + alternate permissions = yes
- +
- .SS available (S)
- This parameter lets you 'turn off' a service. If 'available = no', then
- ALL attempts to connect to the service will fail. Such failures are logged.
- @@ -2421,6 +2445,13 @@
-
- .B Example
- valid users = greg, @pcusers
- +
- +.SS volume (S)
- +This allows you to override the volume label returned for a
- +share. Useful for CDROMs whos installation programs insist on a
- +particular volume label.
- +
- +The default is the name of the share
-
- .SS wide links (S)
- This parameter controls whether or not links in the Unix file system may be
- diff -u -r --new-file last-version/source/Makefile samba-1.9.15p3/source/Makefile
- --- last-version/source/Makefile Tue Nov 21 11:27:50 1995
- +++ samba-1.9.15p3/source/Makefile Wed Nov 22 17:50:54 1995
- @@ -462,13 +462,13 @@
- @echo Linking smbrun
- @$(CC) $(CFLAGS) -o smbrun smbrun.o $(LIBS)
-
- -nmblookup: nmblookup.o $(UTILOBJ)
- +nmblookup: nmblookup.o nmblib.o $(UTILOBJ)
- @echo Linking nmblookup
- @$(CC) $(CFLAGS) -o nmblookup nmblookup.o nmblib.o $(UTILOBJ) $(LIBS)
-
- -nmbd: nameserv.o nmblib.o $(UTILOBJ)
- +nmbd: nameserv.o nmblib.o nmbsync.o $(UTILOBJ)
- @echo Linking nmbd
- - @$(CC) $(CFLAGS) -o nmbd nameserv.o nmblib.o $(PARAMOBJ) $(LIBS)
- + @$(CC) $(CFLAGS) -o nmbd nameserv.o nmblib.o nmbsync.o $(PARAMOBJ) $(LIBS)
-
- smbclient: client.o clitar.o getsmbpass.o $(UTILOBJ)
- @echo Linking smbclient
- diff -u -r --new-file last-version/source/change-log samba-1.9.15p3/source/change-log
- --- last-version/source/change-log Tue Nov 21 12:50:13 1995
- +++ samba-1.9.15p3/source/change-log Wed Nov 22 22:04:02 1995
- @@ -1676,10 +1676,25 @@
- - added SMBcopy
- - added "max ttl" option
- - arch detection patch from Bas Laarhoven <bas@vimec.nl>
- + - released p2
- + - another OS/2 fix - the level 4 getpathinfo for EAs
- + - added "alternate permissions" option
- + - changed client to parse destination names into name + domain
- + - fixed problem with PrimaryGroup and lmhosts loading
- + - added domain master ability to nmbd
- + - added "domain master" option
- + - added "domain controller" option and code
- + - pwd fix to client from Erik Devriendt (de@te6.siemens.be)
- + - fixed problem in smbmv that led to ar not working in mks
- + - added transs2
- + - released p3
-
- +
- ==========
- todo:
-
- +drag long filename to samba under os/2 gives short name
- +
- document max ttl option
-
- dup/close 0 for getopt?
- @@ -1721,6 +1736,7 @@
-
- weird foooooooo/open.exe bug on NT
-
- +%a detection can't detect Win95
-
- lpd stuff:
- Tony Aiuto (tony@ics.com)
- diff -u -r --new-file last-version/source/client.c samba-1.9.15p3/source/client.c
- --- last-version/source/client.c Mon Nov 20 18:54:04 1995
- +++ samba-1.9.15p3/source/client.c Wed Nov 22 20:43:21 1995
- @@ -46,6 +46,7 @@
- #define SHORT_TIMEOUT (5*1000)
-
- int name_type = 0x20;
- +
- int max_protocol = PROTOCOL_NT1;
-
-
- @@ -111,6 +112,9 @@
- int put_total_size = 0;
- int put_total_time_ms = 0;
-
- +
- +extern int Client;
- +
- #ifdef KANJI
- extern int coding_system;
- #define CNV_LANG(s) (coding_system == DOSV_CODE?s:dos_to_unix(s, False))
- @@ -256,8 +260,8 @@
- *p++ = 4;
- strcpy(p,path2);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (report && CVAL(inbuf,smb_rcls) != 0)
- DEBUG(2,("chkpath: %s\n",smb_errstr(inbuf)));
- @@ -292,10 +296,10 @@
-
- set_message(outbuf,0,PTR_DIFF(p,smb_buf(outbuf)),False);
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
-
- - if (!receive_smb(inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- + if (!receive_smb(Client,inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- {
- printf("SMBsendstrt failed. (%s)\n",smb_errstr(inbuf));
- return;
- @@ -332,10 +336,10 @@
- SSVAL(p,1,l);
- memcpy(p+3,msg,l);
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
-
- - if (!receive_smb(inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- + if (!receive_smb(Client,inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- {
- printf("SMBsendtxt failed (%s)\n",smb_errstr(inbuf));
- return;
- @@ -355,10 +359,10 @@
- set_message(outbuf,1,0,False);
- SSVAL(outbuf,smb_vwv0,grp_id);
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
-
- - if (!receive_smb(inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- + if (!receive_smb(Client,inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- {
- printf("SMBsendend failed (%s)\n",smb_errstr(inbuf));
- return;
- @@ -380,8 +384,8 @@
- SSVAL(outbuf,smb_tid,cnum);
- setup_pkt(outbuf);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- DEBUG(0,("Error in dskattr: %s\n",smb_errstr(inbuf)));
- @@ -397,7 +401,8 @@
- ****************************************************************************/
- static void cmd_pwd(void)
- {
- - DEBUG(0,("Current directory is %s%s\n",CNV_LANG(service),CNV_LANG(cur_dir)));
- + DEBUG(0,("Current directory is %s",CNV_LANG(service)));
- + DEBUG(0,("%s\n",CNV_LANG(cur_dir)));
- }
-
-
- @@ -714,8 +719,8 @@
- memcpy(p,status,21);
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- received = SVAL(inbuf,smb_vwv0);
-
- @@ -764,8 +769,8 @@
- p += 2;
- memcpy(p,status,21);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT,False);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT,False);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- DEBUG(0,("Error closing search: %s\n",smb_errstr(inbuf)));
- @@ -800,7 +805,7 @@
-
- *data_len = *param_len = 0;
-
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- return(False);
- @@ -828,7 +833,7 @@
-
- if (total_data <= *data_len && total_param <= *param_len)
- break;
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
- }
-
- return(True);
- @@ -927,7 +932,7 @@
- *p++ = 0; *p++ = 0;
- }
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- receive_trans2_response(inbuf,
- &resp_data_len,&resp_param_len,
- @@ -1153,8 +1158,8 @@
- return;
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1280,8 +1285,8 @@
- smb_setlen(outbuf,smb_len(outbuf)+9);
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1320,7 +1325,7 @@
- SSVAL(outbuf,smb_vwv3,MIN(finfo.size-nread,readbraw_size));
- SSVAL(outbuf,smb_vwv4,0);
- SIVALS(outbuf,smb_vwv5,-1);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- /* Now read the raw data into the buffer and write it */
- if(read_smb_length(Client,inbuf,0) == -1) {
- @@ -1377,8 +1382,8 @@
- SIVAL(outbuf,smb_vwv2,nread);
- SSVAL(outbuf,smb_vwv4,finfo.size - nread);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1421,8 +1426,8 @@
- SSVAL(outbuf,smb_vwv0,fnum);
- SIVALS(outbuf,smb_vwv1,-1);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (!ignore_close_error && CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1451,8 +1456,8 @@
- p += strlen(p)+1;
- *p++ = 4;
- *p = 0;
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
- }
-
- {
- @@ -1684,8 +1689,8 @@
- *p++ = 4;
- strcpy(p,name);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1766,9 +1771,9 @@
- SIVAL(outbuf,smb_vwv3,pos);
- SSVAL(outbuf,smb_vwv7,1);
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- - if (!receive_smb(inbuf,CLIENT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- + if (!receive_smb(Client,inbuf,CLIENT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
- return(0);
-
- _smb_setlen(buf-4,n); /* HACK! XXXX */
- @@ -1776,7 +1781,7 @@
- if (write_socket(Client,buf-4,n+4) != n+4)
- return(0);
-
- - if (!receive_smb(inbuf,CLIENT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0) {
- + if (!receive_smb(Client,inbuf,CLIENT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0) {
- DEBUG(0,("Error writing remote file (2)\n"));
- return(0);
- }
- @@ -1812,8 +1817,8 @@
-
- memcpy(smb_buf(outbuf)+3,buf,n);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0) {
- DEBUG(0,("%s writing remote file\n",smb_errstr(inbuf)));
- @@ -1867,8 +1872,8 @@
- *p++ = 4;
- strcpy(p,rname);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1939,8 +1944,8 @@
- SSVAL(outbuf,smb_vwv0,fnum);
- put_dos_date3(outbuf,smb_vwv1,close_time);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2233,7 +2238,7 @@
- SSVAL(outbuf,smb_tpscnt,6 + strlen(fname)+1);
- SSVAL(outbuf,smb_tdscnt,0);
- SSVAL(outbuf,smb_mprcnt,2);
- - SSVAL(outbuf,smb_mdrcnt,26);
- + SSVAL(outbuf,smb_mdrcnt,65535);
- SSVAL(outbuf,smb_msrcnt,0);
- SSVAL(outbuf,smb_flags,0);
- SIVAL(outbuf,smb_timeout,0);
- @@ -2249,12 +2254,12 @@
- *p++ = 0; /* put in a null smb_name */
- *p++ = 'D'; *p++ = ' '; /* this was added because OS/2 does it */
-
- - SSVAL(p,0,2); /* level */
- + SSVAL(p,0,4); /* level */
- p += 6;
- strcpy(p,fname);
- p = skip_string(p,1);
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- receive_trans2_response(inbuf,
- &resp_data_len,&resp_param_len,
- @@ -2323,8 +2328,8 @@
- *p++ = 4;
- strcpy(p,rname);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2377,8 +2382,8 @@
- CVAL(smb_buf(outbuf),0) = 1;
- SSVAL(smb_buf(outbuf),1,n);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2399,8 +2404,8 @@
-
- SSVAL(outbuf,smb_vwv0,fnum);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2432,8 +2437,8 @@
- SSVAL(outbuf,smb_vwv0,32); /* a max of 20 entries is to be shown */
- SSVAL(outbuf,smb_vwv1,0); /* the index into the queue */
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2513,8 +2518,8 @@
- *p++ = 4;
- strcpy(p,mask);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- DEBUG(0,("%s deleting remote file %s\n",smb_errstr(inbuf),CNV_LANG(mask)));
- @@ -2578,8 +2583,8 @@
- *p++ = 4;
- strcpy(p,mask);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2624,8 +2629,8 @@
- *p++ = 4;
- strcpy(p,dest);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -2770,13 +2775,18 @@
- ****************************************************************************/
- static BOOL send_session_request(char *inbuf,char *outbuf)
- {
- + fstring dest;
- char *p;
- int len = 4;
- /* send a session request (RFC 8002) */
-
- + strcpy(dest,desthost);
- + p = strchr(dest,'.');
- + if (p) *p = 0;
- +
- /* put in the destination name */
- p = outbuf+len;
- - name_mangle(desthost,p,name_type);
- + name_mangle(dest,p,name_type);
- len += name_len(p);
-
- /* and my name */
- @@ -2788,10 +2798,10 @@
- _smb_setlen(outbuf,len);
- CVAL(outbuf,0) = 0x81;
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
- DEBUG(5,("Sent session request\n"));
-
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,0) == 0x84) /* C. Hoch 9/14/95 Start */
- {
- @@ -2946,8 +2956,8 @@
-
- CVAL(smb_buf(outbuf),0) = 2;
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- show_msg(inbuf);
-
- @@ -3086,8 +3096,8 @@
- set_message(outbuf,13,PTR_DIFF(p,smb_buf(outbuf)),False);
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- show_msg(inbuf);
-
- @@ -3178,8 +3188,8 @@
- strcpy(p,dev);
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- /* trying again with a blank password */
- if (CVAL(inbuf,smb_rcls) != 0 &&
- @@ -3236,8 +3246,8 @@
- SSVAL(outbuf,smb_tid,cnum);
- setup_pkt(outbuf);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,SHORT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,SHORT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -3300,8 +3310,8 @@
-
- set_message(outbuf,14,PTR_DIFF(p2+drcnt,smb_buf(outbuf)),False);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) == 0)
- {
- @@ -3455,11 +3465,7 @@
- {
- char *p,*rparam,*rdata;
- pstring param;
- -#if 0
- - int uLevel = atoi(getenv("XX_ULEVEL"));
- -#else
- int uLevel = 1;
- -#endif
-
- int servertype = SV_TYPE_ALL;
-
- @@ -3724,7 +3730,7 @@
- }
- #endif
- if (FD_ISSET(Client,&fds))
- - receive_smb(buffer,0);
- + receive_smb(Client,buffer,0);
-
- #ifdef CLIX
- delay++;
- @@ -3758,8 +3764,8 @@
- SSVAL(outbuf,smb_tid,cnum);
- setup_pkt(outbuf);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,SHORT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,SHORT_TIMEOUT);
-
- close_sockets();
- if (!open_sockets(0)) return(False);
- diff -u -r --new-file last-version/source/clitar.c samba-1.9.15p3/source/clitar.c
- --- last-version/source/clitar.c Mon Nov 6 16:17:43 1995
- +++ samba-1.9.15p3/source/clitar.c Wed Nov 22 15:05:30 1995
- @@ -31,6 +31,7 @@
-
- #define SEPARATORS " \t\n\r"
- extern int DEBUGLEVEL;
- +extern int Client;
-
- /* These defines are for the do_setrattr routine, to indicate
- * setting and reseting of file attributes in the function call */
- @@ -293,8 +294,8 @@
- *p++ = 4;
- *p++ = 0;
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- DEBUG(5,("getatr: %s\n",smb_errstr(inbuf)));
- @@ -331,8 +332,8 @@
- *p++ = 4;
- *p++ = 0;
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -417,8 +418,8 @@
- smb_setlen(outbuf,smb_len(outbuf)+11*2+1);
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -551,8 +552,8 @@
- smb_setlen(outbuf,smb_len(outbuf)+9);
- }
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -592,7 +593,7 @@
- SSVAL(outbuf,smb_vwv3,MIN(finfo.size-nread,readbraw_size));
- SSVAL(outbuf,smb_vwv4,0);
- SIVALS(outbuf,smb_vwv5,-1);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- /* Now read the raw data into the buffer and write it */
- if(read_smb_length(Client,inbuf,0) == -1) {
- @@ -649,8 +650,8 @@
- SIVAL(outbuf,smb_vwv2,nread);
- SSVAL(outbuf,smb_vwv4,finfo.size - nread);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -701,8 +702,8 @@
- SSVAL(outbuf,smb_vwv0,fnum);
- SIVALS(outbuf,smb_vwv1,-1);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (!ignore_close_error && CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -928,8 +929,8 @@
- *p++ = 4;
- strcpy(p,finfo.name);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -965,8 +966,8 @@
- CVAL(smb_buf(outbuf),0) = 1;
- SSVAL(smb_buf(outbuf),1,n);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1001,8 +1002,8 @@
- asctime(LocalTime(&finfo.mtime,GMT_TO_LOCAL)),
- finfo.mtime));
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- @@ -1029,8 +1030,8 @@
- *p++ = 4;
- strcpy(p,fname);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- DEBUG(5,("smbchkpath: %s\n",smb_errstr(inbuf)));
-
- @@ -1054,8 +1055,8 @@
- *p++ = 4;
- strcpy(p,fname);
-
- - send_smb(outbuf);
- - receive_smb(inbuf,CLIENT_TIMEOUT);
- + send_smb(Client,outbuf);
- + receive_smb(Client,inbuf,CLIENT_TIMEOUT);
-
- if (CVAL(inbuf,smb_rcls) != 0)
- {
- diff -u -r --new-file last-version/source/getsmbpass.c samba-1.9.15p3/source/getsmbpass.c
- --- last-version/source/getsmbpass.c Sat Nov 11 11:03:57 1995
- +++ samba-1.9.15p3/source/getsmbpass.c Wed Nov 22 21:55:33 1995
- @@ -18,20 +18,9 @@
-
- /* Modified to use with samba by Jeremy Allison, 8th July 1995. */
-
- -#ifdef SUNOS4
- -#define _sys_ioctl_h
- -#endif
- -
- -#ifdef SUNOS5
- -#define _SYS_IOCTL_H
- -#endif
- -
- #include "includes.h"
-
- #ifdef REPLACE_GETPASS
- -
- -
- -#include <termios.h>
-
- #ifdef SYSV_TERMIO
-
- diff -u -r --new-file last-version/source/includes.h samba-1.9.15p3/source/includes.h
- --- last-version/source/includes.h Tue Nov 14 22:10:06 1995
- +++ samba-1.9.15p3/source/includes.h Wed Nov 22 21:55:27 1995
- @@ -217,6 +217,7 @@
- #include <errno.h>
- #include <sys/wait.h>
- #include <signal.h>
- +#include <termios.h>
- #ifdef sun386
- #define NO_STRFTIME
- #define NO_UTIMBUF
- @@ -245,6 +246,7 @@
- #include <arpa/inet.h>
- #include <rpcsvc/ypclnt.h>
- #include <crypt.h>
- +#include <termios.h>
- extern int gettimeofday (struct timeval *, void *);
- extern int gethostname (char *name, int namelen);
- extern int innetgr (const char *, const char *, const char *, const char *);
- diff -u -r --new-file last-version/source/ipc.c samba-1.9.15p3/source/ipc.c
- --- last-version/source/ipc.c Sat Nov 18 02:08:09 1995
- +++ samba-1.9.15p3/source/ipc.c Wed Nov 22 21:08:05 1995
- @@ -65,6 +65,8 @@
- #define SNLEN 15 /* service name length */
- #define QNLEN 12 /* queue name maximum length */
-
- +extern int Client;
- +
- static int CopyExpanded(int cnum, int snum, char** dst, char* src, int* n)
- {
- pstring buf;
- @@ -157,7 +159,7 @@
- SSVAL(outbuf,smb_vwv10+i*SIZEOFWORD,setup[i]);
-
- show_msg(outbuf);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- tot_data = this_ldata;
- tot_param = this_lparam;
- @@ -184,7 +186,7 @@
- SSVAL(outbuf,smb_vwv9,0);
-
- show_msg(outbuf);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- tot_data += this_ldata;
- tot_param += this_lparam;
- @@ -1513,6 +1515,8 @@
- char *p2;
- int struct_len;
-
- + DEBUG(4,("NetServerGetInfo level %d\n",uLevel));
- +
- /* check it's a supported varient */
- if (!prefix_ok(str1,"WrLh")) return False;
- switch( uLevel ) {
- @@ -1550,17 +1554,34 @@
-
- p = *rdata;
- p2 = p + struct_len;
- - if (uLevel != 20) StrnCpy(p,local_machine,16);
- + if (uLevel != 20) {
- + StrnCpy(p,local_machine,16);
- + strupper(p);
- + }
- p += 16;
- if (uLevel > 0)
- {
- + struct server_info_struct *servers=NULL;
- + int i,count;
- pstring comment;
- - SCVAL(p,0,1); /* version_major */
- - SCVAL(p,1,9); /* version_minor */
- - SIVAL(p,2,SV_TYPE_WORKSTATION|SV_TYPE_SERVER|SV_TYPE_TIME_SOURCE
- - /*|SV_TYPE_DOMAIN_CTRL*/); /* type */
- - SIVAL(p,6,PTR_DIFF(p2,*rdata));
- + uint32 servertype=SV_TYPE_SERVER_UNIX|SV_TYPE_WORKSTATION|
- + SV_TYPE_SERVER|SV_TYPE_TIME_SOURCE;
- +
- strcpy(comment,lp_serverstring());
- +
- + if ((count=get_server_info(SV_TYPE_ALL,&servers))>0) {
- + for (i=0;i<count;i++)
- + if (strequal(servers[i].name,local_machine)) {
- + servertype = servers[i].type;
- + strcpy(comment,servers[i].comment);
- + }
- + }
- + if (servers) free(servers);
- +
- + SCVAL(p,0,2); /* version_major */
- + SCVAL(p,1,0); /* version_minor */
- + SIVAL(p,2,servertype);
- + SIVAL(p,6,PTR_DIFF(p2,*rdata));
- standard_sub(cnum,comment);
- StrnCpy(p2,comment,MAX(mdrcnt - struct_len,0));
- p2 = skip_string(p2,1);
- @@ -1630,8 +1651,8 @@
- p2 = skip_string(p2,1);
- p += 4;
-
- - SCVAL(p,0,1); /* major version?? */
- - SCVAL(p,1,9); /* minor version?? */
- + SCVAL(p,0,2); /* major version?? */
- + SCVAL(p,1,1); /* minor version?? */
- p += 2;
-
- SIVAL(p,0,PTR_DIFF(p2,*rdata));
- @@ -2523,7 +2544,7 @@
- of the parameter/data bytes */
- outsize = set_message(outbuf,0,0,True);
- show_msg(outbuf);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
- }
-
- /* receive the rest of the trans packet */
- @@ -2531,7 +2552,7 @@
- {
- int pcnt,poff,dcnt,doff,pdisp,ddisp;
-
- - receive_smb(inbuf, 0);
- + receive_smb(Client,inbuf, 0);
- show_msg(inbuf);
-
- /* Ensure this is still a trans packet (sanity check) */
- diff -u -r --new-file last-version/source/loadparm.c samba-1.9.15p3/source/loadparm.c
- --- last-version/source/loadparm.c Tue Nov 21 12:42:00 1995
- +++ samba-1.9.15p3/source/loadparm.c Wed Nov 22 18:00:55 1995
- @@ -128,6 +128,7 @@
- char *szSocketOptions;
- char *szValidChars;
- char *szWorkGroup;
- + char *szDomainController;
- char *szUsernameMap;
- char *szCharacterSet;
- int max_log_size;
- @@ -145,6 +146,7 @@
- int os_level;
- int max_ttl;
- BOOL bPreferredMaster;
- + BOOL bDomainMaster;
- BOOL bEncryptPasswords;
- BOOL bStripDot;
- BOOL bNullPasswords;
- @@ -196,10 +198,12 @@
- char *force_group;
- char *readlist;
- char *writelist;
- + char *volume;
- int iMinPrintSpace;
- int iCreate_mode;
- int iMaxConnections;
- int iDefaultCase;
- + BOOL bAlternatePerm;
- BOOL bRevalidate;
- BOOL bCaseSensitive;
- BOOL bCasePreserve;
- @@ -265,10 +269,12 @@
- NULL, /* force group */
- NULL, /* readlist */
- NULL, /* writelist */
- + NULL, /* volume */
- 0, /* iMinPrintSpace */
- 0755, /* iCreate_mode */
- 0, /* iMaxConnections */
- CASE_LOWER, /* iDefaultCase */
- + False, /* bAlternatePerm */
- False, /* revalidate */
- False, /* case sensitive */
- False, /* case preserve */
- @@ -375,6 +381,7 @@
- {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL},
- {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars},
- {"workgroup", P_STRING, P_GLOBAL, &Globals.szWorkGroup, NULL},
- + {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL},
- {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL},
- {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set},
- {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL},
- @@ -394,6 +401,7 @@
- {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL},
- {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL},
- {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL},
- + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL},
-
- {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL},
- {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL},
- @@ -404,6 +412,7 @@
- {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL},
- {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL},
- {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL},
- + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL},
- {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL},
- {"default case", P_INTEGER, P_LOCAL, &sDefault.iDefaultCase, handle_case},
- {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL},
- @@ -426,6 +435,7 @@
- {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL},
- {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL},
- {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL},
- + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL},
- {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL},
- {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL},
- {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL},
- @@ -538,6 +548,7 @@
- Globals.os_level = 0;
- Globals.max_ttl = 60*60*4; /* 2 hours default */
- Globals.bPreferredMaster = True;
- + Globals.bDomainMaster = False;
-
- #ifdef KANJI
- coding_system = interpret_coding_system (KANJI, SJIS_CODE);
- @@ -643,9 +654,11 @@
- FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat)
- FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer)
- FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup)
- +FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController)
- FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap)
- FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet)
-
- +FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster)
- FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster)
- FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters)
- FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts)
- @@ -702,8 +715,10 @@
- FN_LOCAL_STRING(lp_force_group,force_group)
- FN_LOCAL_STRING(lp_readlist,readlist)
- FN_LOCAL_STRING(lp_writelist,writelist)
- +FN_LOCAL_STRING(lp_volume,volume)
- FN_LOCAL_STRING(lp_mangled_map,szMangledMap)
-
- +FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm)
- FN_LOCAL_BOOL(lp_revalidate,bRevalidate)
- FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive)
- FN_LOCAL_BOOL(lp_preservecase,bCasePreserve)
- @@ -1828,3 +1843,12 @@
- return(res);
- }
-
- +/*******************************************************************
- + a useful volume label function
- + ******************************************************************/
- +char *volume_label(int snum)
- +{
- + char *ret = lp_volume(snum);
- + if (!*ret) return(lp_servicename(snum));
- + return(ret);
- +}
- diff -u -r --new-file last-version/source/loadparm.h samba-1.9.15p3/source/loadparm.h
- --- last-version/source/loadparm.h Tue Nov 21 12:42:14 1995
- +++ samba-1.9.15p3/source/loadparm.h Wed Nov 22 18:01:21 1995
- @@ -51,11 +51,13 @@
- extern char *lp_dfree_command(void);
- extern char *lp_msg_command(void);
- extern char *lp_workgroup(void);
- +extern char *lp_domain_controller(void);
- extern char *lp_username_map(void);
- extern char *lp_hosts_equiv(void);
- extern char *lp_magicscript(int iService);
- extern char *lp_magicoutput(int iService);
- extern char *lp_mangled_map(int iService);
- +char *volume_label(int snum);
- extern int lp_os_level(void);
- extern int lp_max_ttl(void);
- extern int lp_max_log_size(void);
- @@ -63,6 +65,7 @@
- extern int lp_maxmux(void);
- extern int lp_mangledstack(void);
- extern BOOL lp_preferred_master(void);
- +extern BOOL lp_domain_master(void);
- extern BOOL lp_getwdcache(void);
- extern BOOL lp_use_rhosts(void);
- extern BOOL lp_readprediction(void);
- @@ -107,6 +110,7 @@
- extern char *lp_force_group(int iService);
- extern char *lp_readlist(int iService);
- extern char *lp_writelist(int iService);
- +extern BOOL lp_alternate_permissions(int iService);
- extern BOOL lp_revalidate(int iService);
- extern BOOL lp_status(int iService);
- extern BOOL lp_hide_dot_files(int iService);
- diff -u -r --new-file last-version/source/nameserv.c samba-1.9.15p3/source/nameserv.c
- --- last-version/source/nameserv.c Tue Nov 21 12:44:03 1995
- +++ samba-1.9.15p3/source/nameserv.c Wed Nov 22 21:14:57 1995
- @@ -29,6 +29,8 @@
- void process(void);
- static void dump_names(void);
- static void announce_request(char *group);
- +void sync_browse_lists(char *name,int name_type,char *myname,
- + char *domain,struct in_addr ip);
-
- extern int DEBUGLEVEL;
-
- @@ -77,7 +79,8 @@
- /* what server type are we currently */
- static int ServerType =
- SV_TYPE_WORKSTATION | SV_TYPE_SERVER | SV_TYPE_TIME_SOURCE |
- -SV_TYPE_PRINTQ_SERVER | SV_TYPE_SERVER_UNIX | SV_TYPE_POTENTIAL_BROWSER;
- +SV_TYPE_SERVER_UNIX |
- +SV_TYPE_PRINTQ_SERVER | SV_TYPE_POTENTIAL_BROWSER;
-
- /* here are my election parameters */
-
- @@ -367,12 +370,15 @@
-
- bzero((char *)d,sizeof(*d));
-
- + if (zero_ip(ip)) ip = bcast_ip;
- +
- StrnCpy(d->name,name,sizeof(d->name)-1);
- d->bcast_ip = ip;
-
- - if (!*PrimaryGroup && ip_equal(bcast_ip,ip) && name[0] != '*') {
- + if (!PrimaryGroup[0] && ip_equal(bcast_ip,ip) && name[0] != '*') {
- strcpy(PrimaryGroup,name);
- strupper(PrimaryGroup);
- + DEBUG(3,("Setting primary group to %s (%s)\n",PrimaryGroup,inet_ntoa(ip)));
- }
-
- add_domain(d);
- @@ -389,17 +395,24 @@
- /****************************************************************************
- add a server entry
- ****************************************************************************/
- -static struct server_record *add_server_entry(char *name,int servertype,
- - int ttl,char *comment)
- +struct server_record *add_server_entry(char *name,int servertype,
- + int ttl,char *comment,BOOL replace)
- {
- BOOL newentry=False;
- struct server_record *s;
-
- - updatedlists=True;
- + ttl = MIN(ttl,lp_max_ttl());
-
- for (s = serverlist; s; s = s->next)
- if (strequal(name,s->name)) break;
-
- + if (s && !replace) {
- + DEBUG(4,("Not replacing %s\n",name));
- + return(s);
- + }
- +
- + updatedlists=True;
- +
- if (!s) {
- newentry = True;
- s = (struct server_record *)malloc(sizeof(*s));
- @@ -421,8 +434,13 @@
-
- add_server(s);
-
- - DEBUG(3,("Added server entry %s of type %x (%s)\n",
- - name,servertype,comment));
- + if (newentry) {
- + DEBUG(3,("Added server entry %s of type %x (%s)\n",
- + name,servertype,comment));
- + } else {
- + DEBUG(3,("Updated server entry %s of type %x (%s)\n",
- + name,servertype,comment));
- + }
-
- return(s);
- }
- @@ -435,8 +453,6 @@
- {
- struct in_addr ip = *interpret_addr2("0.0.0.0");
-
- - add_host_entry("__SAMBA__",0x20,True,0,SELF,ip);
- - add_host_entry("__SAMBA__",0x0,True,0,SELF,ip);
- add_host_entry(myname,0x20,True,0,SELF,ip);
- add_host_entry(myname,0x0,True,0,SELF,ip);
- add_host_entry(myname,0x1f,True,0,SELF,ip); /* used for chat, I think */
- @@ -444,9 +460,13 @@
- add_domain_entry(lp_workgroup(),bcast_ip);
- add_server_entry(myname,
- ServerType,
- - 0,ServerComment);
- + 0,ServerComment,True);
- +
- + add_host_entry("__SAMBA__",0x20,True,0,SELF,ip);
- + add_host_entry("__SAMBA__",0x0,True,0,SELF,ip);
-
- if (lp_preferred_master()) {
- + DEBUG(3,("Preferred master startup\n"));
- needelection = True;
- ElectionCriterion |= (1<<3);
- }
- @@ -565,7 +585,7 @@
- if (t < lastrun + 5*60) return;
- lastrun = t;
-
- - if (!AM_MASTER && *PrimaryGroup &&
- + if (!AM_MASTER && PrimaryGroup[0] &&
- !name_query(ClientNMB,PrimaryGroup,0x1d,True,False,
- bcast_ip,NULL,queue_packet)) {
- DEBUG(2,("Forcing election on %s\n",PrimaryGroup));
- @@ -759,8 +779,14 @@
- add_host_entry(PrimaryGroup,0x1d,True,0,SELF,myip);
- add_host_entry(PrimaryGroup,0x0,False,0,SELF,myip);
- add_host_entry(MSBROWSE,1,False,0,SELF,myip);
- - add_server_entry(PrimaryGroup,SV_TYPE_DOMAIN_ENUM,0,myname);
- - add_server_entry(myname,ServerType,0,ServerComment);
- + add_server_entry(PrimaryGroup,SV_TYPE_DOMAIN_ENUM,0,myname,True);
- + add_server_entry(myname,ServerType,0,ServerComment,True);
- +
- + if (lp_domain_master()) {
- + add_host_entry(PrimaryGroup,0x1b,True,0,SELF,myip);
- + add_host_entry(PrimaryGroup,0x1c,False,0,SELF,myip);
- + ServerType |= SV_TYPE_DOMAIN_MASTER;
- + }
-
- announce_request(PrimaryGroup);
-
- @@ -779,12 +805,18 @@
- DEBUG(2,("Becoming non-master for %s\n",PrimaryGroup));
-
- ServerType &= ~SV_TYPE_MASTER_BROWSER;
- + ServerType &= ~SV_TYPE_DOMAIN_MASTER;
- +
- ElectionCriterion &= ~0x4;
-
- make_nmb_name(&nn,PrimaryGroup,0x1d,scope);
- n = find_name(&nn);
- if (n && n->source == SELF) remove_name(n);
-
- + make_nmb_name(&nn,PrimaryGroup,0x1b,scope);
- + n = find_name(&nn);
- + if (n && n->source == SELF) remove_name(n);
- +
- make_nmb_name(&nn,MSBROWSE,1,scope);
- n = find_name(&nn);
- if (n && n->source == SELF) remove_name(n);
- @@ -799,7 +831,7 @@
- time_t t = time(NULL);
- static time_t lastime = 0;
-
- - if (!*PrimaryGroup || !RunningElection) return;
- + if (!PrimaryGroup[0] || !RunningElection) return;
-
- /* send election packets once a second */
- if (lastime &&
- @@ -863,7 +895,7 @@
- StrnCpy(p+5,my_name,16);
- strupper(p+5);
- CVAL(p,21) = 2; /* major version */
- - CVAL(p,22) = 0; /* minor version */
- + CVAL(p,22) = 2; /* minor version */
- stypep = p+23;
- SIVAL(p,23,ServerType);
- SSVAL(p,27,0xaa55); /* browse signature */
- @@ -929,6 +961,57 @@
- myname,group,0,0,bcast_ip,myip);
- }
-
- +/****************************************************************************
- + announce myself as a master to the PDC
- + **************************************************************************/
- +static void announce_master(char *group)
- +{
- + static time_t last=0;
- + time_t t = time(NULL);
- + pstring outbuf;
- + char *p;
- + struct in_addr ip,pdc_ip;
- + fstring pdcname="";
- +
- + if (!AM_MASTER || (last && (t-last < 10*60))) return;
- + last = t;
- +
- + ip = *interpret_addr2(lp_domain_controller());
- +
- + if (zero_ip(ip)) ip = bcast_ip;
- +
- + if (!name_query(ClientNMB,PrimaryGroup,
- + 0x1b,False,False,ip,&pdc_ip,queue_packet)) {
- + DEBUG(2,("Failed to find PDC at %s\n",lp_domain_controller()));
- + return;
- + }
- +
- + name_status(ClientNMB,PrimaryGroup,0x1b,False,
- + pdc_ip,NULL,pdcname,queue_packet);
- +
- + if (!pdcname[0]) {
- + DEBUG(3,("Can't find netbios name of PDC at %s\n",inet_ntoa(pdc_ip)));
- + } else {
- + sync_browse_lists(pdcname,0x20,myname,PrimaryGroup,pdc_ip);
- + }
- +
- +
- + DEBUG(2,("Sending master announce to %s for workgroup %s\n",
- + inet_ntoa(pdc_ip),group));
- +
- + bzero(outbuf,sizeof(outbuf));
- + p = outbuf;
- + CVAL(p,0) = 13; /* announce request */
- + p++;
- +
- + StrnCpy(p,myname,16);
- + strupper(p);
- + p = skip_string(p,1);
- +
- + send_udp_dgram(ClientDGRAM,outbuf,PTR_DIFF(p,outbuf),
- + PrimaryGroup,myname,0x1b,0,pdc_ip,myip);
- +}
- +
-
- /*******************************************************************
- am I listening on a name. Should check name_type as well
- @@ -989,10 +1072,32 @@
- ttl = MIN(ttl,lp_max_ttl());
-
- /* add them to our browse list */
- - add_server_entry(name,servertype,ttl,comment);
- + add_server_entry(name,servertype,ttl,comment,True);
- +
- }
-
- +/*******************************************************************
- + process a master announcement frame
- + ******************************************************************/
- +static void process_master_announce(struct packet_struct *p,char *buf)
- +{
- + struct dgram_packet *dgram = &p->packet.dgram;
- + char *name = buf;
- +
- + name[15] = 0;
- +
- + DEBUG(3,("Master Announce from %s (%s)\n",name,inet_ntoa(p->ip)));
- +
- + if (strequal(dgram->source_name.name,myname)) return;
- +
- + if (!AM_MASTER || !listening(&dgram->dest_name)) return;
- +
- + /* merge browse lists with them */
- + if (lp_domain_master())
- + sync_browse_lists(name,0x20,myname,PrimaryGroup,p->ip);
- +}
-
- +
- /*******************************************************************
- process a backup list request
-
- @@ -1143,6 +1248,10 @@
- case 9: /* get backup list */
- process_backup_list(p,buf+1);
- break;
- +
- + case 13: /* master announcement */
- + process_master_announce(p,buf+1);
- + break;
- }
- }
-
- @@ -1199,7 +1308,7 @@
- ret = name_query(ClientNMB,name1,0x1,True,False,ip,&ipout,queue_packet);
- if (!ret) return(False);
-
- - name_status(ClientNMB,name1,0x1,False,ipout,name,queue_packet);
- + name_status(ClientNMB,name1,0x1,False,ipout,name,NULL,queue_packet);
-
- if (name[0] != '*') {
- DEBUG(2,("Found workgroup %s on broadcast %s\n",name,inet_ntoa(ip)));
- @@ -1226,7 +1335,7 @@
- if (!find_workgroup(d->name,d->bcast_ip)) continue;
- add_host_entry(d->name,0x1e,False,0,SELF,
- *interpret_addr2("255.255.255.255"));
- - if (!*PrimaryGroup && ip_equal(bcast_ip,d->bcast_ip)) {
- + if (!PrimaryGroup[0] && ip_equal(bcast_ip,d->bcast_ip)) {
- strcpy(PrimaryGroup,d->name);
- strupper(PrimaryGroup);
- }
- @@ -1235,6 +1344,10 @@
- announce_host(d,myname,ServerComment);
- }
-
- + /* if I have a domain controller then announce to it */
- + if (AM_MASTER && *lp_domain_controller())
- + announce_master(PrimaryGroup);
- +
- needannounce=False;
- }
-
- @@ -1484,15 +1597,15 @@
- }
-
- /* XXXXXXX we should fill in more fields of the statistics structure */
- - bzero(buf,46);
- - putip(buf,(char *)&myip);
- + bzero(buf,64);
- {
- extern int num_good_sends,num_good_receives;
- SIVAL(buf,20,num_good_sends);
- SIVAL(buf,24,num_good_receives);
- }
- + SIVAL(buf,46,0xFFB8E5); /* undocumented - used by NT */
-
- - buf += 46;
- + buf += 64;
-
- nmb2->answers->rdlength = PTR_DIFF(buf,&nmb2->answers->rdata[0]);
-
- @@ -1748,7 +1861,7 @@
- int selrtn;
- struct timeval timeout;
-
- - if (needelection && *PrimaryGroup && !RunningElection) {
- + if (needelection && PrimaryGroup[0] && !RunningElection) {
- DEBUG(3,(">>> Starting election on %s <<<\n",PrimaryGroup));
- ElectionCount = 0;
- RunningElection = True;
- diff -u -r --new-file last-version/source/nameserv.h samba-1.9.15p3/source/nameserv.h
- --- last-version/source/nameserv.h Sun Nov 19 17:50:31 1995
- +++ samba-1.9.15p3/source/nameserv.h Wed Nov 22 18:32:05 1995
- @@ -25,6 +25,7 @@
-
- #define NMB_PORT 137
- #define DGRAM_PORT 138
- +#define SMB_PORT 139
-
- enum name_source {LMHOSTS, REGISTER, SELF, DNS, DNSFAIL};
- enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3};
- @@ -173,7 +174,8 @@
- BOOL bcast,BOOL recurse,
- struct in_addr to_ip, struct in_addr *ip,void (*fn)());
- BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
- - struct in_addr to_ip,char *master,void (*fn)());
- + struct in_addr to_ip,char *master,char *rname,
- + void (*fn)());
- BOOL send_udp_dgram(int fd,char *buf,int len,
- char *srcname,char *dstname,
- int src_type,int dest_type,
- Only in last-version/source: nameserv2.c
- diff -u -r --new-file last-version/source/nmblib.c samba-1.9.15p3/source/nmblib.c
- --- last-version/source/nmblib.c Tue Nov 14 21:23:08 1995
- +++ samba-1.9.15p3/source/nmblib.c Wed Nov 22 18:42:17 1995
- @@ -609,12 +609,15 @@
- /****************************************************************************
- interpret a node status response
- ****************************************************************************/
- -static void interpret_node_status(char *p, char *master)
- +static void interpret_node_status(char *p, char *master,char *rname)
- {
- - int level = master?3:0;
- + int level = (master||rname)?4:0;
- int numnames = CVAL(p,0);
- DEBUG(level,("received %d names\n",numnames));
-
- + if (rname) *rname = 0;
- + if (master) *master = 0;
- +
- p += 1;
- while (numnames--)
- {
- @@ -635,10 +638,15 @@
- if (p[0] & 0x04) strcat(flags,"<ACTIVE> ");
- if (p[0] & 0x02) strcat(flags,"<PERMANENT> ");
-
- - if (master && type == 0x1d) {
- + if (master && !*master && type == 0x1d) {
- StrnCpy(master,qname,15);
- trim_string(master,NULL," ");
- }
- +
- + if (rname && !*rname && type == 0x20 && !(p[0]&0x80)) {
- + StrnCpy(rname,qname,15);
- + trim_string(rname,NULL," ");
- + }
-
- DEBUG(level,("\t%s (type=0x%x)\t%s\n",qname,type,flags));
- p+=2;
- @@ -654,7 +662,8 @@
- the "master" parameter is a hack used for finding workgroups.
- **************************************************************************/
- BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
- - struct in_addr to_ip,char *master,void (*fn)())
- + struct in_addr to_ip,char *master,char *rname,
- + void (*fn)())
- {
- BOOL found=False;
- int retries = 2;
- @@ -730,14 +739,15 @@
- if (nmb2->header.opcode != 0 ||
- nmb2->header.nm_flags.bcast ||
- nmb2->header.rcode ||
- - !nmb2->header.ancount) {
- + !nmb2->header.ancount ||
- + nmb2->answers->rr_type != 0x21) {
- /* XXXX what do we do with this? could be a redirect, but
- we'll discard it for the moment */
- free_packet(p2);
- continue;
- }
-
- - interpret_node_status(&nmb2->answers->rdata[0], master);
- + interpret_node_status(&nmb2->answers->rdata[0], master,rname);
- free_packet(p2);
- return(True);
- }
- diff -u -r --new-file last-version/source/nmblookup.c samba-1.9.15p3/source/nmblookup.c
- --- last-version/source/nmblookup.c Sun Nov 12 12:39:46 1995
- +++ samba-1.9.15p3/source/nmblookup.c Wed Nov 22 18:33:01 1995
- @@ -201,7 +201,7 @@
- if (find_status)
- {
- printf("Looking up status of %s\n",inet_ntoa(ip));
- - name_status(ServerFD,lookup,lookup_type,True,ip,NULL,NULL);
- + name_status(ServerFD,lookup,lookup_type,True,ip,NULL,NULL,NULL);
- printf("\n");
- }
- } else {
- diff -u -r --new-file last-version/source/nmbsync.c samba-1.9.15p3/source/nmbsync.c
- --- last-version/source/nmbsync.c Thu Jan 1 10:00:00 1970
- +++ samba-1.9.15p3/source/nmbsync.c Wed Nov 22 18:16:20 1995
- @@ -0,0 +1,299 @@
- +/*
- + Unix SMB/Netbios implementation.
- + Version 1.9.
- + NBT netbios routines to synchronise browse lists
- + Copyright (C) Andrew Tridgell 1994-1995
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- +
- +*/
- +
- +#include "includes.h"
- +#include "loadparm.h"
- +#include "nameserv.h"
- +
- +extern int DEBUGLEVEL;
- +
- +struct server_record *add_server_entry(char *name,int servertype,
- + int ttl,char *comment,BOOL replace);
- +
- +
- +/****************************************************************************
- +call a remote api
- +****************************************************************************/
- +static BOOL call_remote_api(int fd,int cnum,int uid,int timeout,
- + char *inbuf,char *outbuf,
- + int prcnt,int drcnt,
- + int mprcnt,int mdrcnt,
- + int *rprcnt,int *rdrcnt,
- + char *param,char *data,
- + char **rparam,char **rdata)
- +{
- + char *p1,*p2;
- +
- + /* send a SMBtrans command */
- + bzero(outbuf,smb_size);
- + set_message(outbuf,14,0,True);
- + CVAL(outbuf,smb_com) = SMBtrans;
- + SSVAL(outbuf,smb_tid,cnum);
- + SSVAL(outbuf,smb_uid,uid);
- +
- + p1 = smb_buf(outbuf);
- + strcpy(p1,"\\PIPE\\LANMAN");
- + p1 = skip_string(p1,1);
- + p2 = p1 + prcnt;
- +
- + if (prcnt > 0)
- + memcpy(p1,param,prcnt);
- + if (drcnt > 0)
- + memcpy(p2,data,drcnt);
- +
- + SSVAL(outbuf,smb_vwv0,prcnt); /* param count */
- + SSVAL(outbuf,smb_vwv1,drcnt); /* data count */
- + SSVAL(outbuf,smb_vwv2,mprcnt); /* mprcnt */
- + SSVAL(outbuf,smb_vwv3,mdrcnt); /* mdrcnt */
- + SSVAL(outbuf,smb_vwv4,0); /* msrcnt */
- + SSVAL(outbuf,smb_vwv5,0); /* flags */
- + SSVAL(outbuf,smb_vwv9,prcnt); /* pscnt */
- + SSVAL(outbuf,smb_vwv10,smb_offset(p1,outbuf)); /* psoff */
- + SSVAL(outbuf,smb_vwv11,drcnt); /* dscnt */
- + SSVAL(outbuf,smb_vwv12,smb_offset(p2,outbuf)); /* dsoff */
- + CVAL(outbuf,smb_vwv13) = 0; /* suwcnt */
- +
- + set_message(outbuf,14,PTR_DIFF(p2+drcnt,smb_buf(outbuf)),False);
- +
- + send_smb(fd,outbuf);
- +
- + if (receive_smb(fd,inbuf,timeout) &&
- + CVAL(inbuf,smb_rcls) == 0)
- + {
- + if (rparam)
- + *rparam = inbuf+4 + SVAL(inbuf,smb_vwv4);
- + if (rdata)
- + *rdata = inbuf+4 + SVAL(inbuf,smb_vwv7);
- + if (rprcnt)
- + *rprcnt = SVAL(inbuf,smb_vwv3);
- + if (rdrcnt)
- + *rdrcnt = SVAL(inbuf,smb_vwv6);
- + return(True);
- + }
- +
- + return(False);
- +}
- +
- +
- +/*******************************************************************
- + synchronise browse lists with another browse server
- + ******************************************************************/
- +void sync_browse_lists(char *name,int name_type,char *myname,
- + char *domain,struct in_addr ip)
- +{
- + char *protocol = "LM1.2X002";
- + char *service = "IPC$";
- + char *dev = "IPC";
- + int timeout=2000;
- + char *inbuf=NULL;
- + pstring outbuf;
- + char *p;
- + int len;
- + uint32 sesskey;
- + int cnum,uid;
- + BOOL ret;
- +
- + int fd = open_socket_out(SOCK_STREAM, &ip, SMB_PORT);
- + if (fd < 0) {
- + DEBUG(3,("Failed to connect to %s at %s\n",name,inet_ntoa(ip)));
- + return;
- + }
- +
- + if (!(inbuf = (char *)malloc(0xFFFF+1024))) return;
- +
- + /* put in the destination name */
- + len = 4;
- + p = outbuf+len;
- + name_mangle(name,p,name_type);
- + len += name_len(p);
- +
- + /* and my name */
- + p = outbuf+len;
- + name_mangle(myname,p,0x20);
- + len += name_len(p);
- +
- + _smb_setlen(outbuf,len);
- + CVAL(outbuf,0) = 0x81;
- +
- + send_smb(fd,outbuf);
- + receive_smb(fd,inbuf,5000);
- +
- + bzero(outbuf,smb_size);
- +
- + /* setup the protocol string */
- + set_message(outbuf,0,strlen(protocol)+2,True);
- + p = smb_buf(outbuf);
- + *p++ = 2;
- + strcpy(p,protocol);
- +
- + CVAL(outbuf,smb_com) = SMBnegprot;
- + CVAL(outbuf,smb_flg) = 0x8;
- + SSVAL(outbuf,smb_flg2,0x1);
- +
- + send_smb(fd,outbuf);
- + bzero(inbuf,smb_size);
- + ret = receive_smb(fd,inbuf,timeout);
- +
- + if (!ret || CVAL(inbuf,smb_rcls) || SVAL(inbuf,smb_vwv0)) {
- + DEBUG(3,("%s rejected the protocol\n",name));
- + close(fd);
- + if (inbuf) free(inbuf);
- + return;
- + }
- +
- + sesskey = IVAL(inbuf,smb_vwv6);
- +
- + bzero(outbuf,smb_size);
- + set_message(outbuf,10,2,True);
- + CVAL(outbuf,smb_com) = SMBsesssetupX;
- +
- + CVAL(outbuf,smb_vwv0) = 0xFF;
- + SSVAL(outbuf,smb_vwv2,0xFFFF);
- + SSVAL(outbuf,smb_vwv3,2);
- + SSVAL(outbuf,smb_vwv4,1);
- + SIVAL(outbuf,smb_vwv5,sesskey);
- + SSVAL(outbuf,smb_vwv7,1);
- +
- + send_smb(fd,outbuf);
- + bzero(inbuf,smb_size);
- + ret = receive_smb(fd,inbuf,timeout);
- + if (!ret || CVAL(inbuf,smb_rcls)) {
- + DEBUG(3,("%s rejected session setup\n",name));
- + close(fd);
- + if (inbuf) free(inbuf);
- + return;
- + }
- +
- + uid = SVAL(inbuf,smb_uid);
- +
- + bzero(outbuf,smb_size);
- + set_message(outbuf,4,2 + strlen(service) + 1 + strlen(dev),True);
- + CVAL(outbuf,smb_com) = SMBtconX;
- + SSVAL(outbuf,smb_uid,uid);
- +
- + SSVAL(outbuf,smb_vwv0,0xFF);
- + SSVAL(outbuf,smb_vwv3,1);
- +
- + p = smb_buf(outbuf) + 1;
- + strcpy(p,service);
- + p = skip_string(p,1);
- + strcpy(p,dev);
- +
- + send_smb(fd,outbuf);
- + bzero(inbuf,smb_size);
- + ret = receive_smb(fd,inbuf,timeout);
- + if (!ret || CVAL(inbuf,smb_rcls)) {
- + DEBUG(3,("%s rejected IPC connect (%d,%d)\n",name,
- + CVAL(inbuf,smb_rcls),SVAL(inbuf,smb_err)));
- + close(fd);
- + if (inbuf) free(inbuf);
- + return;
- + }
- +
- + cnum = SVAL(inbuf,smb_tid);
- +
- + /* now I need to send a NetServerEnum */
- + {
- + fstring param;
- + uint32 *typep;
- + char *rparam,*rdata;
- +
- + p = param;
- + SSVAL(p,0,0x68); /* api number */
- + p += 2;
- + strcpy(p,"WrLehDz");
- + p = skip_string(p,1);
- +
- + strcpy(p,"B16BBDz");
- +
- + p = skip_string(p,1);
- + SSVAL(p,0,1); /* level 1 */
- + SSVAL(p,2,0xFFFF - 500); /* buf length */
- + p += 4;
- + typep = (uint32 *)p;
- + p += 4;
- + strcpy(p,domain);
- + strupper(p);
- + p = skip_string(p,1);
- +
- + SIVAL(typep,0,0x80000000); /* domain list */
- +
- + if (call_remote_api(fd,cnum,uid,timeout,inbuf,outbuf,
- + PTR_DIFF(p,param),0,
- + 8,0xFFFF - 500,
- + NULL,NULL,
- + param,NULL,
- + &rparam,&rdata) && SVAL(rparam,0)==0)
- + {
- + int converter=SVAL(rparam,2);
- + int count=SVAL(rparam,4);
- + int i;
- + char *p2 = rdata;
- + for (i=0;i<count;i++) {
- + char *sname = p2;
- + uint32 type = IVAL(p2,18);
- + int comment_offset = IVAL(p2,22) & 0xFFFF;
- + char *comment = comment_offset?(rdata+comment_offset-converter):"";
- +
- + add_server_entry(sname,type,lp_max_ttl(),comment,False);
- + p2 += 26;
- + }
- + }
- +
- + SIVAL(typep,0,0xFFFFFFFF); /* server list */
- +
- + if (call_remote_api(fd,cnum,uid,timeout,inbuf,outbuf,
- + PTR_DIFF(p,param),0,
- + 8,0xFFFF - 500,
- + NULL,NULL,
- + param,NULL,
- + &rparam,&rdata) && SVAL(rparam,0)==0)
- + {
- + int converter=SVAL(rparam,2);
- + int count=SVAL(rparam,4);
- + int i;
- +
- + p = rdata;
- + for (i=0;i<count;i++) {
- + char *sname = p;
- + uint32 type = IVAL(p,18);
- + int comment_offset = IVAL(p,22) & 0xFFFF;
- + char *comment = comment_offset?(rdata+comment_offset-converter):"";
- +
- + add_server_entry(sname,type,lp_max_ttl(),comment,False);
- + p += 26;
- + }
- + }
- + }
- +
- + /* close up */
- + bzero(outbuf,smb_size);
- + set_message(outbuf,0,0,True);
- + CVAL(outbuf,smb_com) = SMBtdis;
- + SSVAL(outbuf,smb_uid,uid);
- + SSVAL(outbuf,smb_tid,cnum);
- + send_smb(fd,outbuf);
- + receive_smb(fd,inbuf,1000);
- +
- + close(fd);
- + if (inbuf) free(inbuf);
- +}
- diff -u -r --new-file last-version/source/password.c samba-1.9.15p3/source/password.c
- --- last-version/source/password.c Sun Nov 12 12:29:44 1995
- +++ samba-1.9.15p3/source/password.c Wed Nov 22 14:57:44 1995
- @@ -1202,8 +1202,6 @@
- pstring inbuf,outbuf;
- fstring pass_protocol;
- extern fstring remote_machine;
- - extern int Client;
- - int SavedClient = Client;
- char *p;
- int len;
- fstring desthost;
- @@ -1266,10 +1264,8 @@
- _smb_setlen(outbuf,len);
- CVAL(outbuf,0) = 0x81;
-
- - Client = password_client;
- - send_smb(outbuf);
- - receive_smb(inbuf,5000);
- - Client = SavedClient;
- + send_smb(password_client,outbuf);
- + receive_smb(password_client,inbuf,5000);
-
- if (CVAL(inbuf,0) != 0x82) {
- DEBUG(1,("%s rejected the session\n",pserver));
- @@ -1291,10 +1287,8 @@
- CVAL(outbuf,smb_flg) = 0x8;
- SSVAL(outbuf,smb_flg2,0x1);
-
- - Client = password_client;
- - send_smb(outbuf);
- - ret = receive_smb(inbuf,5000);
- - Client = SavedClient;
- + send_smb(password_client,outbuf);
- + ret = receive_smb(password_client,inbuf,5000);
-
- if (!ret || CVAL(inbuf,smb_rcls) || SVAL(inbuf,smb_vwv0)) {
- DEBUG(1,("%s rejected the protocol\n",pserver));
- @@ -1321,8 +1315,6 @@
- BOOL server_validate(char *buf)
- {
- pstring inbuf,outbuf;
- - extern int Client;
- - int SavedClient = Client;
- char *pserver = lp_passwordserver();
- BOOL ret;
-
- @@ -1343,10 +1335,8 @@
-
- SCVAL(inbuf,smb_rcls,1);
-
- - Client = password_client;
- - send_smb(outbuf);
- - ret = receive_smb(inbuf,5000);
- - Client = SavedClient;
- + send_smb(password_client,outbuf);
- + ret = receive_smb(password_client,inbuf,5000);
-
- if (!ret || CVAL(inbuf,smb_rcls) != 0) {
- DEBUG(1,("password server %s rejected the password\n",pserver));
- diff -u -r --new-file last-version/source/reply.c samba-1.9.15p3/source/reply.c
- --- last-version/source/reply.c Tue Nov 21 00:06:48 1995
- +++ samba-1.9.15p3/source/reply.c Wed Nov 22 21:35:16 1995
- @@ -761,7 +761,7 @@
- if ((dirtype&0x1F) == aVOLID)
- {
- memcpy(p,status,21);
- - make_dir_struct(p,"???????????",SERVICE(SNUM(cnum)),0,aVOLID,0);
- + make_dir_struct(p,"???????????",volume_label(SNUM(cnum)),0,aVOLID,0);
- dptr_fill(p+12,dptr_num);
- if (dptr_zero(p+12) && (status_len==0))
- numentries = 1;
- @@ -1577,7 +1577,7 @@
- CVAL(outbuf,smb_com) = SMBwritebraw;
- SSVALS(outbuf,smb_vwv0,-1);
- outsize = set_message(outbuf,Protocol>PROTOCOL_COREPLUS?1:0,0,True);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- /* Now read the raw data into the buffer and write it */
- if(read_smb_length(Client,inbuf,0) == -1) {
- @@ -2107,7 +2107,7 @@
-
- smb_setlen(outbuf,outsize - 4);
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
- }
-
- DEBUG(3,("%s echo %d times cnum=%d\n",timestring(),smb_reverb,cnum));
- @@ -2519,6 +2519,10 @@
- !file_exist(newname,NULL) &&
- !sys_rename(directory,newname)) count++;
- if (!count) exists = file_exist(directory,NULL);
- + if (!count && exists && file_exist(newname,NULL)) {
- + exists = True;
- + error = 183;
- + }
- } else {
- void *dirptr = NULL;
- char *dname;
- @@ -2545,9 +2549,14 @@
- sprintf(fname,"%s/%s",directory,dname);
- if (!can_rename(fname,cnum)) continue;
- strcpy(destname,newname);
- - if (resolve_wildcards(fname,destname) &&
- - !file_exist(destname,NULL) &&
- - !sys_rename(fname,destname)) count++;
- +
- + if (!resolve_wildcards(fname,destname)) continue;
- +
- + if (file_exist(destname,NULL)) {
- + error = 183;
- + continue;
- + }
- + if (!sys_rename(fname,destname)) count++;
- DEBUG(3,("reply_mv : doing rename on %s -> %s\n",fname,destname));
- }
- CloseDir(dirptr);
- @@ -2932,7 +2941,7 @@
- SSVAL(outbuf,smb_vwv6,nread);
- SSVAL(outbuf,smb_vwv7,smb_offset(data,outbuf));
-
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- total_read += nread;
- startpos += nread;
- @@ -3027,7 +3036,7 @@
- if (write_through && tcount==nwritten) {
- /* we need to send both a primary and a secondary response */
- smb_setlen(outbuf,outsize - 4);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- /* now the secondary */
- outsize = set_message(outbuf,1,0,True);
- @@ -3194,7 +3203,7 @@
- else
- {
- SIVAL(outbuf,smb_vwv6,sbuf.st_size);
- - SIVAL(outbuf,smb_vwv8,sbuf.st_size);
- + SIVAL(outbuf,smb_vwv8,ROUNDUP(sbuf.st_size,1024));
- }
- SSVAL(outbuf,smb_vwv10, mode);
-
- diff -u -r --new-file last-version/source/reply.h samba-1.9.15p3/source/reply.h
- --- last-version/source/reply.h Mon Nov 20 22:59:13 1995
- +++ samba-1.9.15p3/source/reply.h Wed Nov 22 21:52:38 1995
- @@ -57,3 +57,4 @@
- int reply_sendstrt(char *inbuf,char *outbuf);
- int reply_sendend(char *inbuf,char *outbuf);
- int reply_sendtxt(char *inbuf,char *outbuf);
- +int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
- diff -u -r --new-file last-version/source/server.c samba-1.9.15p3/source/server.c
- --- last-version/source/server.c Tue Nov 21 12:49:16 1995
- +++ samba-1.9.15p3/source/server.c Wed Nov 22 21:50:33 1995
- @@ -159,7 +159,7 @@
- Connections[cnum].igroups))))
- result |= aRONLY;
- #else
- - if (CAN_WRITE(cnum)) {
- + if (CAN_WRITE(cnum) && !lp_alternate_permissions(SNUM(cnum))) {
- if (!((sbuf->st_mode & S_IWOTH) ||
- Connections[cnum].admin_user ||
- ((sbuf->st_mode & S_IWUSR) && Connections[cnum].uid==sbuf->st_uid) ||
- @@ -2860,6 +2860,36 @@
- }
-
-
- +/* these are the protocol lists used for auto architecture detection:
- +
- +WinNT 3.51:
- +protocol [PC NETWORK PROGRAM 1.0]
- +protocol [XENIX CORE]
- +protocol [MICROSOFT NETWORKS 1.03]
- +protocol [LANMAN1.0]
- +protocol [Windows for Workgroups 3.1a]
- +protocol [LM1.2X002]
- +protocol [LANMAN2.1]
- +protocol [NT LM 0.12]
- +
- +Win95:
- +protocol [PC NETWORK PROGRAM 1.0]
- +protocol [XENIX CORE]
- +protocol [MICROSOFT NETWORKS 1.03]
- +protocol [LANMAN1.0]
- +protocol [Windows for Workgroups 3.1a]
- +protocol [LM1.2X002]
- +protocol [LANMAN2.1]
- +protocol [NT LM 0.12]
- +
- +OS/2:
- +protocol [PC NETWORK PROGRAM 1.0]
- +protocol [XENIX CORE]
- +protocol [LANMAN1.0]
- +protocol [LM1.2X002]
- +protocol [LANMAN2.1]
- +*/
- +
- /****************************************************************************
- reply to a negprot
- ****************************************************************************/
- @@ -3441,7 +3471,7 @@
- {SMBfindnclose, "SMBfindnclose", reply_findnclose, AS_USER},
- {SMBfindclose, "SMBfindclose", reply_findclose,AS_USER},
- {SMBtrans2, "SMBtrans2", reply_trans2, AS_USER},
- - {SMBtranss2, "SMBtranss2", NULL, AS_USER},
- + {SMBtranss2, "SMBtranss2", reply_transs2, AS_USER},
-
- /* messaging routines */
- {SMBsends,"SMBsends",reply_sends,AS_GUEST},
- @@ -3797,7 +3827,7 @@
- errno = 0;
-
- for (counter=SMBD_SELECT_LOOP;
- - !receive_smb(InBuffer,SMBD_SELECT_LOOP*1000);
- + !receive_smb(Client,InBuffer,SMBD_SELECT_LOOP*1000);
- counter += SMBD_SELECT_LOOP)
- {
- int i;
- @@ -3898,7 +3928,7 @@
- smb_len(OutBuffer)));
- }
- else
- - send_smb(OutBuffer);
- + send_smb(Client,OutBuffer);
- }
- trans_num++;
- }
- diff -u -r --new-file last-version/source/smb.h samba-1.9.15p3/source/smb.h
- --- last-version/source/smb.h Tue Nov 14 21:55:41 1995
- +++ samba-1.9.15p3/source/smb.h Wed Nov 22 14:58:18 1995
- @@ -749,11 +749,11 @@
- BOOL file_exist(char *fname,struct stat *sbuf);
- int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt, long time_out, BOOL exact);
- void close_sockets(void );
- -BOOL send_smb(char *buffer);
- +BOOL send_smb(int fd,char *buffer);
- BOOL send_keepalive(int client);
- int read_data(int fd,char *buffer,int N);
- int smb_len(char *buf);
- -BOOL receive_smb(char *buffer,int timeout);
- +BOOL receive_smb(int fd,char *buffer,int timeout);
- void show_msg(char *buf);
- BOOL big_endian(void );
- BOOL become_user(int cnum, int uid);
- @@ -977,6 +977,8 @@
-
- /* this is how errors are generated */
- #define UNIXERROR(defclass,deferror) unix_error_packet(inbuf,outbuf,defclass,deferror,__LINE__)
- +
- +#define ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1))
-
- #endif
- /* _SMB_H */
- diff -u -r --new-file last-version/source/trans2.c samba-1.9.15p3/source/trans2.c
- --- last-version/source/trans2.c Mon Nov 20 19:08:34 1995
- +++ samba-1.9.15p3/source/trans2.c Wed Nov 22 21:52:27 1995
- @@ -30,9 +30,8 @@
- extern connection_struct Connections[];
- extern files_struct Files[];
- extern BOOL case_sensitive;
- +extern int Client;
-
- -#define ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1))
- -
- /****************************************************************************
- Send the required number of replies back.
- We assume all fields other than the data fields are
- @@ -64,7 +63,7 @@
- the empty packet */
- if(params_to_send == 0 && data_to_send == 0)
- {
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
- return 0;
- }
-
- @@ -131,7 +130,7 @@
- params_to_send, data_to_send, paramsize, datasize));
-
- /* Send the packet */
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- pp += params_sent_thistime;
- pd += data_sent_thistime;
- @@ -864,7 +863,7 @@
- uint16 info_level = SVAL(params,0);
- int data_len;
- struct stat st;
- - char *sname = lp_servicename(SNUM(cnum));
- + char *vname = volume_label(SNUM(cnum));
-
- DEBUG(3,("call_trans2qfsinfo: cnum = %d, level = %d\n", cnum, info_level));
-
- @@ -894,11 +893,11 @@
- case 2:
- {
- /* Return volume name */
- - int volname_len = MIN(strlen(sname),11);
- + int volname_len = MIN(strlen(vname),11);
- data_len = l2_vol_szVolLabel + volname_len + 1;
- put_dos_date2(pdata,l2_vol_fdateCreation,st.st_ctime);
- SCVAL(pdata,l2_vol_cch,volname_len);
- - StrnCpy(pdata+l2_vol_szVolLabel,sname,volname_len);
- + StrnCpy(pdata+l2_vol_szVolLabel,vname,volname_len);
- DEBUG(5,("call_trans2qfsinfo : time = %x, namelen = %d, name = %s\n",st.st_ctime,volname_len,
- pdata+l2_vol_szVolLabel));
- break;
- @@ -911,14 +910,14 @@
- PutUniCode(pdata+12,FSTYPE_STRING);
- break;
- case SMB_QUERY_FS_LABEL_INFO:
- - data_len = 4 + strlen(sname);
- - SIVAL(pdata,0,strlen(sname));
- - strcpy(pdata+4,sname);
- + data_len = 4 + strlen(vname);
- + SIVAL(pdata,0,strlen(vname));
- + strcpy(pdata+4,vname);
- break;
- case SMB_QUERY_FS_VOLUME_INFO:
- - data_len = 17 + strlen(sname);
- - SIVAL(pdata,12,strlen(sname));
- - strcpy(pdata+17,sname);
- + data_len = 17 + strlen(vname);
- + SIVAL(pdata,12,strlen(vname));
- + strcpy(pdata+17,vname);
- break;
- case SMB_QUERY_FS_SIZE_INFO:
- {
- @@ -1062,8 +1061,7 @@
- break;
-
- case 3:
- - case 4:
- - data_size = (info_level==3?24:28);
- + data_size = 24;
- put_dos_date2(pdata,0,sbuf.st_ctime);
- put_dos_date2(pdata,4,sbuf.st_atime);
- put_dos_date2(pdata,8,sbuf.st_mtime);
- @@ -1072,6 +1070,11 @@
- SIVAL(pdata,20,mode);
- break;
-
- + case 4:
- + data_size = 4;
- + SIVAL(pdata,0,data_size);
- + break;
- +
- case 6:
- return(ERROR(ERRDOS,ERRbadfunc)); /* os/2 needs this */
-
- @@ -1468,6 +1471,15 @@
-
-
- /****************************************************************************
- + reply to a SMBtranss2 - just ignore it!
- +****************************************************************************/
- +int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize)
- +{
- + DEBUG(4,("Ignoring transs2 of length %d\n",length));
- + return(-1);
- +}
- +
- +/****************************************************************************
- reply to a SMBtrans2
- ****************************************************************************/
- int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize)
- @@ -1524,11 +1536,11 @@
- /* We need to send an interim response then receive the rest
- of the parameter/data bytes */
- outsize = set_message(outbuf,0,0,True);
- - send_smb(outbuf);
- + send_smb(Client,outbuf);
-
- while( num_data_sofar < total_data || num_params_sofar < total_params)
- {
- - receive_smb(inbuf, 0);
- + receive_smb(Client,inbuf, 0);
-
- /* Ensure this is still a trans2 packet (sanity check) */
- if(CVAL(inbuf, smb_com) != SMBtrans2)
- diff -u -r --new-file last-version/source/util.c samba-1.9.15p3/source/util.c
- --- last-version/source/util.c Tue Nov 21 12:39:49 1995
- +++ samba-1.9.15p3/source/util.c Wed Nov 22 17:14:00 1995
- @@ -1940,7 +1940,7 @@
- DEBUG(6,("write_socket(%d,%d)\n",fd,len));
- ret = write_data(fd,buf,len);
-
- - DEBUG(4,("write_socket(%d,%d) gave %d\n",fd,len,ret));
- + DEBUG(6,("write_socket(%d,%d) wrote %d\n",fd,len,ret));
- return(ret);
- }
-
- @@ -2493,10 +2493,9 @@
- read an smb from a fd and return it's length
- The timeout is in milli seconds
- ****************************************************************************/
- -BOOL receive_smb(char *buffer,int timeout)
- +BOOL receive_smb(int fd,char *buffer,int timeout)
- {
- int len;
- - int fd = Client;
- BOOL ok;
-
- bzero(buffer,smb_size + 100);
- @@ -2528,9 +2527,8 @@
- /****************************************************************************
- send an smb to a fd
- ****************************************************************************/
- -BOOL send_smb(char *buffer)
- +BOOL send_smb(int fd,char *buffer)
- {
- - int fd = Client;
- int len;
- int ret,nwritten=0;
- len = smb_len(buffer) + 4;
- diff -u -r --new-file last-version/source/version.h samba-1.9.15p3/source/version.h
- --- last-version/source/version.h Tue Nov 21 12:52:20 1995
- +++ samba-1.9.15p3/source/version.h Wed Nov 22 22:10:03 1995
- @@ -1 +1 @@
- -#define VERSION "1.9.15p2"
- +#define VERSION "1.9.15p3"
- diff -u -r --new-file last-version/source/vt_mode.c samba-1.9.15p3/source/vt_mode.c
- --- last-version/source/vt_mode.c Tue Sep 12 16:28:49 1995
- +++ samba-1.9.15p3/source/vt_mode.c Wed Nov 22 15:01:00 1995
- @@ -318,7 +318,7 @@
- OutBuf [4] = 0x06;
- _smb_setlen(OutBuf, 1);
-
- - send_smb(OutBuf);
- + send_smb(Client,OutBuf);
-
- return(0);
- break;
- @@ -441,13 +441,13 @@
- nread = VT_Input(OutBuffer, MIN(BUFFER_SIZE,lp_maxxmit()));
-
- if(nread > 0)
- - send_smb(OutBuffer);
- + send_smb(Client,OutBuffer);
- }
-
- if(FD_ISSET(Client, &si)) {
- /* got input from socket */
-
- - if(receive_smb(InBuffer, 0)) {
- + if(receive_smb(Client,InBuffer, 0)) {
- msg_type = CVAL(InBuffer,0);
- msg_flags = CVAL(InBuffer,1);
-
- @@ -470,7 +470,7 @@
- nread,
- smb_len(OutBuffer)));
- } else
- - send_smb(OutBuffer);
- + send_smb(Client,OutBuffer);
- }
- }
- } else
-